const Router = require('@koa/router');
const { userValidator, verifyUser, bcryptPassword, verifyLogin } = require('../middleware/user.middleware')
const { auth } = require('../middleware/auth.middleware')
const { register, login, changePassword } = require('../controller/user.controller')
const router = new Router({prefix: '/user'})
router.post('/register', userValidator, verifyUser, bcryptPassword, register)
router.post('/login', userValidator, verifyLogin, login)
router.patch('/', auth, bcryptPassword, changePassword)
module.exports = router